<HEAD> <TITLE> do while loops </TITLE> </HEAD> <BODY BACKGROUND="http://www.imaginary.com/LPMud/Graphics/RecycledPaper.jpg" TEXT=#000000 ALINK=#FFFF00 VLINK=#550000 LINK=#000099> <center> <H1> do while loops </H1> </center>
<p>
The do while loop is very similar to the <A HREF=http://www.imaginary.com/~beek/mudos/lpc/while.html>  while </A> loop, however the condition
isn't checked till the bottom of the loop, meaning the loop with always
execute at least once.
<p>
The syntax is:
<p>
<pre>
do
  statement;
while (expression);
</pre>
<p>
or
<p>
<pre>
do {
  statement;
  ...
} while (expression);
</pre>
<p>
The first form is probably of dubious value b/c it is too easy to confuse
with:
<p>
<pre>
statement;
while (expression);
</pre>
<p>
Which is quite different.
<p>
See also the summary of <A HREF=http://www.imaginary.com/~beek/mudos/lpc/loops.html>  loops </A>.
<p>
<HR> <ADDRESS> <A HREF=http://wagner.princeton.edu/~tim>  Tim Hollebeek </A> <p> <A HREF="http://www.imaginary.com/~beek/">  Beek </A>@ZorkMUD, Lima Bean, IdeaExchange, TMI-2, and elsewhere </ADDRESS>
